package com.v.im.websocketservice;

import com.v.im.websocketservice.websocket.ImWebSocket;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@EnableDiscoveryClient
@EnableFeignClients("com.v.im.businessapi.feign")
@EnableHystrix
@EnableCircuitBreaker
@SpringBootApplication
public class WebsocketServiceApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(WebsocketServiceApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        //解决WebSocket不能注入的问题
        ImWebSocket.setApplicationContext(configurableApplicationContext);
//        SpringApplication.run(WebsocketServiceApplication.class, args);

    }

}

